﻿using System;
using System.Threading.Tasks;

namespace PmSoft.Caching
{
    public interface ICache
    {
        void Add<T>(string key, T value, TimeSpan timeSpan);
        Task AddAsync<T>(string key, T value, TimeSpan timeSpan);

        T? Get<T>(string cacheKey);
        Task<T?> GetAsync<T>(string cacheKey);

        void Remove(string cacheKey);
        Task RemoveAsync(string cacheKey);

        void Set<T>(string key, T value, TimeSpan timeSpan);
        Task SetAsync<T>(string key, T value, TimeSpan timeSpan);
    }
}
